function f(x?: number) {
    // ...
}

f();
f(1);

function f2(x = 10) {
    // ...
}

function forEachArray(array: any[], callabck: (element: any, index: number) => void) {
    for (let index = 0; index < array.length; index++) {
        const element = array[index];
        callabck(element, index);
    }
}

forEachArray([1, 2, 3], (num) => console.log(num));
forEachArray([1, 2, 3], (num, index) => console.log(num, index));

export {};